﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="VehicleModity.aspx.cs" Inherits="Vehicle_Base_VehicleModity" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>

    <script src="../../JavaScript/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
</head>

<body>
    <form id="form1" runat="server">
    <div>
    <%--
        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
            DataSourceID="VehicleSource"  
            oniteminserting="DetailsView1_ItemInserting" >
            
            <Fields>
                <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" 
                    Visible="False" />
                <asp:TemplateField HeaderText="车架号" SortExpression="FrameNO">
                    <EditItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("FrameNO") %>'></asp:Label>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("FrameNO") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("FrameNO") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="车牌号" SortExpression="VehicleID">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("VehicleID") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("VehicleID") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("VehicleID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="车辆类型" SortExpression="VehicleType">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("VehicleType") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("VehicleType") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("VehicleType") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="车辆价格" SortExpression="VehiclePrice">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("VehiclePrice") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("VehiclePrice") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label7" runat="server" Text='<%# Bind("VehiclePrice") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="使用日期" SortExpression="StartUseDate">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("StartUseDate") %>' onClick="WdatePicker()"></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("StartUseDate") %>' 
                            onClick="WdatePicker()"></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label8" runat="server" Text='<%# Bind("StartUseDate") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="计划报废日期" SortExpression="BackupKeyPerson">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("PlanScrapDate") %>' onClick="WdatePicker()"></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox11" runat="server" Text='<%# Bind("PlanScrapDate") %>' 
                            onClick="WdatePicker()"></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("PlanScrapDate") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="KeepPerson" HeaderText="保管人" 
                    SortExpression="KeepPerson" />
                <asp:BoundField DataField="BackupKeyPerson" HeaderText="备用钥匙管理人" 
                    SortExpression="BackupKeyPerson" />
              <asp:TemplateField HeaderText="机构" Visible="False">
                    <EditItemTemplate>
                        <asp:DropDownList ID="ddl_Organ" runat="server" DataSourceID="sourceDDL" 
                            DataTextField="OrganName" DataValueField="OrganID" AppendDataBoundItems="True" 
                            ondatabinding="ddl_PlanDate_DataBinding">
                        </asp:DropDownList>
                        <asp:Label ID="lab_Organ" runat="server" Text='<%# Eval("OrganID") %>' Visible="False"></asp:Label>
                        <asp:ObjectDataSource ID="sourceDDL" runat="server" SelectMethod="GetAllList" 
                            TypeName="BLL.OrganBLL"></asp:ObjectDataSource>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                         <asp:DropDownList ID="ddl_Organ" runat="server" DataSourceID="sourceDDL" 
                            DataTextField="OrganName" DataValueField="OrganID" AppendDataBoundItems="True" 
                            SelectedValue='<%# Bind("OrganID")%>'>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="sourceDDL" runat="server" SelectMethod="GetAllList" 
                            TypeName="BLL.OrganBLL"></asp:ObjectDataSource>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("OrganID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="ChargePerson" HeaderText="负责人" 
                    SortExpression="ChargePerson" />
                <asp:BoundField DataField="SuperChargePerson" HeaderText="总负责人" 
                    SortExpression="SuperChargePerson" />
      
                <asp:TemplateField ShowHeader="False">
                    <EditItemTemplate>
                        <asp:Button ID="LinkButton1" runat="server" CausesValidation="True" 
                            CommandName="Update" Text="更新"></asp:Button>
                       
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:Button ID="LinkButton2" runat="server" CausesValidation="True" 
                            CommandName="Insert" Text="插入"></asp:Button>
                    </InsertItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
      
            </Fields>
        </asp:DetailsView>--%>
        <asp:ObjectDataSource ID="VehicleSource" runat="server"  DeleteMethod="Delete" InsertMethod="Add" 
            SelectMethod="GetModel" TypeName="BLL.VehicleBLL" UpdateMethod="Update" 
            DataObjectTypeName="Model.Vehicle" onupdated="VehicleSource_Updated" >
            <DeleteParameters>
                <asp:Parameter Name="FrameNO" Type="String" />
            </DeleteParameters>
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="FrameNO" Name="FrameNO" 
                    QueryStringField="FrameNO" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
    
        <asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="VehicleSource" 
            Height="125px" Width="146px">
            
             <Fields>
                <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" 
                    Visible="False" />
                <asp:TemplateField HeaderText="车架号" SortExpression="FrameNO">
                    <EditItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("FrameNO") %>'></asp:Label>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("FrameNO") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("FrameNO") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="车牌号" SortExpression="VehicleID">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("VehicleID") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("VehicleID") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("VehicleID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="车辆类型" SortExpression="VehicleType">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("VehicleType") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("VehicleType") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("VehicleType") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="车辆价格" SortExpression="VehiclePrice">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("VehiclePrice") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("VehiclePrice") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label7" runat="server" Text='<%# Bind("VehiclePrice") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="使用日期" SortExpression="StartUseDate">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("StartUseDate") %>' onClick="WdatePicker()"></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("StartUseDate") %>' 
                            onClick="WdatePicker()"></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label8" runat="server" Text='<%# Bind("StartUseDate") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="计划报废日期" SortExpression="BackupKeyPerson">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("PlanScrapDate") %>' onClick="WdatePicker()"></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox11" runat="server" Text='<%# Bind("PlanScrapDate") %>' 
                            onClick="WdatePicker()"></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("PlanScrapDate") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="KeepPerson" HeaderText="保管人" 
                    SortExpression="KeepPerson" />
                <asp:BoundField DataField="BackupKeyPerson" HeaderText="备用钥匙管理人" 
                    SortExpression="BackupKeyPerson" />
<%--                <asp:TemplateField HeaderText="机构" Visible="False">
                    <EditItemTemplate>
                        <asp:DropDownList ID="ddl_Organ" runat="server" DataSourceID="sourceDDL" 
                            DataTextField="OrganName" DataValueField="OrganID" AppendDataBoundItems="True" 
                            ondatabinding="ddl_PlanDate_DataBinding">
                        </asp:DropDownList>
                        <asp:Label ID="lab_Organ" runat="server" Text='<%# Eval("OrganID") %>' Visible="False"></asp:Label>
                        <asp:ObjectDataSource ID="sourceDDL" runat="server" SelectMethod="GetAllList" 
                            TypeName="BLL.OrganBLL"></asp:ObjectDataSource>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                         <asp:DropDownList ID="ddl_Organ" runat="server" DataSourceID="sourceDDL" 
                            DataTextField="OrganName" DataValueField="OrganID" AppendDataBoundItems="True" 
                            SelectedValue='<%# Bind("OrganID")%>'>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="sourceDDL" runat="server" SelectMethod="GetAllList" 
                            TypeName="BLL.OrganBLL"></asp:ObjectDataSource>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("OrganID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>--%>
                <asp:BoundField DataField="ChargePerson" HeaderText="负责人" 
                    SortExpression="ChargePerson" />
                <asp:BoundField DataField="SuperChargePerson" HeaderText="总负责人" 
                    SortExpression="SuperChargePerson" />
      
                <asp:TemplateField ShowHeader="False">
                    <EditItemTemplate>
                        <asp:Button ID="LinkButton1" runat="server" CausesValidation="True" 
                            CommandName="Update" Text="更新"></asp:Button>
                       
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:Button ID="LinkButton2" runat="server" CausesValidation="True" 
                            CommandName="Insert" Text="插入"></asp:Button>
                    </InsertItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
      
            </Fields>
            
            
        </asp:DetailsView>
    
    </div>
    </form>
</body>
</html>
